/*
 * MyLock.hpp
 *
 *  Created on: 2013-1-17
 *      Author: heqiu
 */

#ifndef MYLOCK_HPP_
#define MYLOCK_HPP_

#include "mycomm.h"
class MyLock {
public:
	MyLock() {
		m_bufferLock = SDL_CreateMutex();
	}
	~MyLock() {
		SDL_DestroyMutex(m_bufferLock);
	}
	void lock() {
		SDL_mutexP(m_bufferLock);
	}
	void unlock() {
		SDL_mutexV(m_bufferLock);
	}
private:
	SDL_mutex *m_bufferLock;
};

#endif /* MYLOCK_HPP_ */
